<?php
function page_intro(){
  $output = theme('page_intro');
  $output .= node_extra_home_news_left();
  $output .= node_extra_home_news_right();
  return $output;
}

function page_website(){
  $output = page_website_items();
  $output .= page_website_terms();
  return $output;
}

function page_website_items(){
  $select = db_select('node', 'n')->extend('PagerDefault');
  $select = $select->fields('n', array('nid'))
                    ->condition('n.status', 1)
                    ->condition('n.type', 'website')
                    ->orderBy('n.created', 'desc')
                    ->limit(20)
                    ->execute()
                    ->fetchAll();
  return '';                  
}

function page_website_terms(){
  $voca = taxonomy_vocabulary_machine_name_load('website');
  $tree = taxonomy_get_tree($voca->vid);
  $items = array();
  foreach ($tree as $tid => $term) {
    $items[] = l($term->name, 'taxonomy/term/'.$tid);
  }
  return theme('website_term_list', array('items' => $items));
}